
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>BOM</title>
</head>
<body>
	<script>
/*		//Nanigator对象
		var a = navigator.appCodeName,
			//浏览器代码名
			b = navigator.appName,
			//浏览器名
			c = navigator.appVersion,
			//平台及版本信息
			d = navigator.cookieEnabled,
			//cookie是否被启用，返回布尔值
			e = navigator.platform,
			//系统平台信息
			f = navigator.userAgent;
			//返回客服端的user-agent头部的值
			console.log(f);

		//screen对象
		var a1 = screen.availHeight,
			//返回显示屏幕的可用高度
			a2 = screen.availWidth,
			//返回显示屏幕的可用宽度
			a3 = screen.height,
			//返回屏幕的像素高度
			a4 = screen.width,
			//返回屏幕的像素宽度
			a5 = screen.colorDepth;
			//返回屏幕的颜色位数
			
		//history对象
		history.back;  //后退一页

		history.forward();  //前进一页

		history.go(-1);  //传个n,n为正数前进n页，n为负数后退n页
		
		var b1 = history.length;	//历史记录的条数
		//location对象
		var c1 = location.hash,
			//返回锚点包括#的字符串
			c2 = location.host,
			//返回主机名加端口号
			//端口默认是80端口,默认请求的网页是index.html
			c3 = location.hostname,
			//返回主机名（域名）
			c4 = location.port,
			//返回端口号
			c5 = location.href,
			//返回完整的URL   (location.href='';用于javascript逻辑中的网页跳转)
			c6 = location.protocol,
			//返回当前URL的协议（http:  https:  ...）
			c7 = location.search;
			//返回包括？的搜索参数
			//location.assign('index.html');//  当前页面加载新文档（另外一个JS跳转逻辑）
			//location.reload();  //刷新的逻辑
			//location.replace('index.html')  //替换内容
	
			myWindow = window.open('' , '', 'width=200,height=100');
								//(URL , name, features, replace) 创建新窗口
			myWindow.document.write("This is 'myWindow'");
			myWindow.moveBy(100, 100);

			//定时器
			//请求延迟 定时器递归 常用setTimeout
			//作为参数的函数称为回调函数
			var aaa = null;
			var timer = setTimeout(function(){
				if(aaa){
					alert('我很帅');
				}else{
					alert('请求失败');
				}

			},2000);
			clertTimeout(timer);
*/
		console.log(screenTop);//IE,窗口左上角的Y轴坐标
		console.log(screenLeft); //IE,窗口左上角的X轴坐标
		window.onscroll = function (){
			console.log('IE:' + document.documentElement.scrollTop);//垂直滚动距离
		}
		//非IE浏览器
		console.log(screenX);
		console.log(screenY);
		var sTop = screenTop || screenY;
		window.onscroll = function (){
			console.log('~:' + pageYOffset);//垂直滚动距离
		}
		//IE与其他浏览器有区别
		var sTop = document.documentElement.scrollTop || pageYOffset;
		console.log(sTop);
	</script>
</body>
</html>